<%@page import="java.util.Iterator"%>
<%@page import="com.xhd.vo.Tuijian"%>
<%@page import="com.xhd.vo.Fruits"%>
<%@page import="java.util.List"%>
<%@page import="com.xhd.Dao.SalerDaoImpl"%>
<%@page import="com.xhd.Dao.SalerDao"%>
<%@page import="java.util.Calendar"%>
<%@page import="java.util.Date"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
#top{
	width:100%;
	height:80px;
}
#left{
	width:20%;
	height:620px;
	float:left;
}
#right{
	width:80%;
	height:620px;
	float:left;
	overflow: hidden;
}
#right iframe {
        width: 100%;
        height: 620px;
        top: 0;
        left: 0;
        transform-origin: top left;
        transform: scale(0.8, 0.88)
    }
ul{
	list-style:none;
	margin:0 auto;
}
ul li{
	padding:5px;
}
a{
text-decoration:none;
}


</style>
</head>
<body style="background: rgb(254,238,189);">
<%
	SimpleDateFormat formatter= new SimpleDateFormat("yyyy-MM-dd");
	Date date = new Date();
	String date1=formatter.format(date);
	Calendar calendar = Calendar.getInstance();
	 //记得要+1
	int month = calendar.get(Calendar.MONTH) + 1;
	%>
<div id="top" style="background:gray;">
<h2 style="padding-top:25px;"><%=month %>月热销水果</h2>

</div>

<div id="left" style="background:gray;">
<div id="top" style="background:gray;">

	<%
	SalerDao sd = new SalerDaoImpl();
	List<Tuijian> tuijianlist=sd.showTuijian();
	Iterator<Tuijian> TIter=tuijianlist.iterator();
	String m=String.valueOf(month)+"月";

	if (!TIter.hasNext()){
	%>	
		本月暂无推荐水果,点击此处查看其他月份推荐水果
	<%	
	}
	else {
		Tuijian tuijian=null;
		while(TIter.hasNext()){
			tuijian=TIter.next();
			
	%>
	
	<%
   	
   	if(tuijian.getYuefen().equals(m)) {%>
   	<br>	
   	<%=tuijian.getTuijian() %><br>
    推荐理由：<%=tuijian.getTjly() %>
    <%--
    String fruitname=sd.FruitExist(tuijian.getTuijian());
    if(tuijian.getTuijian().equals(fruitname)) {--%>
    <img src="./image/dz.png" width="20px" height="20px" background="grey"><br>
    
    
	<% 
		}
   	%>
 
    <br>
    <br>
    <%	
    } } 
    %>
    <br/>
    	<li>
			<a href="Jijie2.jsp" target="content">点击填写意向购买信息</a>
		</li>
</div>
	
</div>
<div id="right">
	<iframe name="content" src="image/fruit.webp" width="100%" height="620" frameborder="0"></iframe>
</div>
<a href="HomePage.jsp">返回主界面</a>
</body>
